package com.yanqu.road.server.cmd.cross.player;

import com.yanqu.road.pb.player.PlayerProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.S_CROSS_TO_WATCH_PLAYER_PATRONS_RESP, desc = "跨服拜访玩家门客响应")
public class CrossWatchPlayerPatronsRespCmd extends AbstractCommand {

	@Override
	public boolean parseData(YanQuMessage packet) throws Exception {
		return true;
	}

	@Override
	public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
		PlayerProto.CrossWatchPlayerPatronsRespMsg reqMsg = PlayerProto.CrossWatchPlayerPatronsRespMsg.parseFrom(packet.getBytes());
		PlayerProto.WatchPlayerPatronsRespMsg.Builder respMsg = PlayerProto.WatchPlayerPatronsRespMsg.newBuilder();
		respMsg.setServerId(reqMsg.getWatchServerId());
		respMsg.setUserId(reqMsg.getWatchUserId());
		respMsg.setNickName(reqMsg.getNickName());
		respMsg.setPatronsId(reqMsg.getPatronsId());
		respMsg.setPatronsInfo(reqMsg.getRespData());
		player.sendPacket(Protocol.U_WATCH_PLAYER_PATRONS, respMsg);
	}

	@Override
	public void sendData(GamePlayer player) {

	}
}
